package com.java.grammer;

public class ForTest_6_Triangle {
    public static void main(String[] args) {
        int i, j, k, hang = 7;
        for (i = 1; i <= hang / 2 + 1; i++) {
            for (j = 1; j <= (hang - (2 * i - 1)) / 2; j++) {
                System.out.print(" ");
            }
            for (k = 1; k <= 2 * i - 1; k++) {
                if (k % 2 != 0)
                    System.out.print("*");
                else
                    System.out.print(" ");
            }

            System.out.println();
        }


    }
}